package com.cch.enums;

/**
 * Created by xiaojin.du on 2017/2/13.
 */
public enum WeekDayEnum {
    MON("星期一"),
    TUE("星期二"),
    WED("星期三"),
    THU("星期四"),
    FRI("星期五"),
    SAT("星期六"),
    SUN("星期天");

    private String name;

    private Integer dayOfWeek;//与 Calendar 中的 dayOfWeek 定义一致

    WeekDayEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static WeekDayEnum getEnumByStr(String weekDayStr) {
        for (WeekDayEnum weekDayEnum : WeekDayEnum.values()) {
            if(weekDayEnum.toString().equals(weekDayStr)){
                return weekDayEnum;
            }
        }
        return null;
    }
}
